<div class="findtrs" >
	<form action="" class="layui-inline layui-form" method="post" style="width: 100%;">
		<div class="ftitle">
			<div class="lt">
				<h2>充值码充值</h2>
			</div>
		</div>
		<div class="fremittanpred fbai" >
			<div class="list">
				<ul>
					<li style="min-width: 400px;">
						<label>充值码 <i>*</i></label>
						<input type="text" class="info" name="card_num" lay-verify="required" lay-verType="tips" placeholder="请输入充值码" >
						<br />
						<label>充值码密码 <i>*</i></label>
						<input type="text" class="info" name="card_pwd" lay-verify="required" lay-verType="tips" placeholder="请输入充值码密码" >
						<br />
<!--						<i style="font-size: 18px;">*未<a href="javascript:;" style="font-size: 20px;font-weight: bold;color: red" id="ftianj"> 实名认证 </a> 用户提交无效,请选择<a href="{:url('fund/onLine')}" style="font-size: 20px;font-weight: bold;color: red"> 在线充值 </a>.-->
<!--							</span><br/><br/>-->
<!--						</i>-->
						<div class="fbottonlst" style="float: left;">
							<i style="font-size: 20px;">* 未 <a href="javascript:;" style="font-size: 21px;font-weight: bold;color: red" id="ftianj"> 实名认证 </a> 用户提交无效.
								</span><br/><br/>
							</i>
							<ul style="justify-content: left;min-width: 350px">

								<li class="on">
									<input type="button" class="fsubmit" lay-submit lay-filter="edit" style="float: left" value="提 交" >
								</li>
								<li style="padding-left: 50px;">
									<a href="{:url('fund/index')}">返回</a>
								</li>
							</ul>
						</div>
					</li>
					<li style="padding-left: 20px;min-width: 550px;">
						<label>
							<img src="__STATIC__/lib/index/images/czmtbtp.png" alt="" style="width: 235px;height: 235px;min-width: 235px;min-height: 235px;" >
						</label>
						<p style="padding-left: 12px;font-size: 18px;color: red">
							<span style="font-size: 20px;color: #ffa700;font-weight: bold">50美元充值码</span><br/><br/>
							请使用手机淘宝购买充值码.<br/>
							淘宝下单后会自动发送充值码,确认收货才后会自动发送充值码密码.<br/>
							如不同意该充值流程，请勿购买.
						</p>
					</li>
				</ul>
			</div>

		</div>
	</form>
	<div class="funaduibi fbai">
		<div class="fdbtable qmfdbtable ftable fboxbai">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="dataTable">
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
	layui.use(['form','table'], function() {
		var form = layui.form,
				table = layui.table; //表格

		form.on('submit(edit)', function(data){
			const grade = '{$grade}';
			if(grade == 0){
				window.location.href = "{:url('user/account')}";
				return false;
			}
			var loading =layer.load(1, {shade: [0.1,'#fff']});
			JsPost("{:url('cardCheck')}", data.field, function(res){
				layer.close(loading);
				if(res.code >0){
					layer.msg(res.msg, {time:1500}, function(){
						window.location.href = "{:url('card')}";
					});
				}else{
					layer.msg(res.msg , {time:1500});
				}
			})
		});

		$('#ftianj').click(function(){
			const grade = '{$grade}';
			if(grade != 0){
				layer.msg('用户已认证', {time:1500});
				return false;
			}
			window.location.href = "{:url('user/account')}";
		})

		var tableIn = table.render({
			elem: '#dataTable',
			height: 'auto',
			cellMinWidth: '80',
			// totalRow: true,
			method: 'post',
			url: "{:url('card')}",
			id: 'dataTable',
			cols: [[
				{ type: 'numbers'},
				{ align: 'center', title: '使用时间' , width: 160,
					templet: function (d) {
						var utime = d.utime;
						if(utime == null){
							return ' -- ';
						}else{
							return layui.util.toDateString(utime * 1000, "yyyy-MM-dd HH:mm:ss");
						}
					},totalRowText:'Total:'
				},
				{ field: 'amount', title: '金额($)', align:"right",width:120,
					style:'color:#FF5722;font-weight:bold',totalRow: true},
				{ field: 'value',  align: 'left', title: '充值码'},
			]],
			page: true,
			limit: 10,
			limits: [10,  50 , 100]
		});

		// $('#ftianj').click(function(){
		// 	const grade = '{$grade}';
		// 	if(grade == '1'){
		// 		layer.msg('用户已认证', {time:1500});
		// 		return false;
		// 	}
		// 	$('.mcmask').show();
		// 	$('#rz_detail').show();
		// })
		// $('.mcadtanc .icons_rz').click(function(){
		// 	$('.mcmask').hide();
		// 	$('#rz_detail').hide();
		// })
		// $(document).on('click', '#rz_sub', function () {
		// 	var rz_name = $("#rz_name").val();
		// 	var rz_card = $("#rz_card").val();
		// 	var index = layer.load(1, {shade: [0.1, '#fff']});
		// 	JsPost('{:url("user/rzSend")}', {rz_name:rz_name,rz_card:rz_card},function (re) {
		// 		layer.close(index);
		// 		if(re.code >0){
		// 			layer.msg(re.msg , {time:3500});
		// 			window.location.href = "{:url('card')}";
		// 		}else{
		// 			layer.msg(re.msg, {time:1500});
		// 		}
		// 	});
		// });
	});
</script>